<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: Compiler/platform abstraction</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__compiler__abstraction.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle">
<div class="title">Compiler/platform abstraction<div class="ingroups"><a class="el" href="group__lwip.html">lwIP</a> &raquo; <a class="el" href="group__sys__layer.html">Porting (system abstraction layer)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga1771b7fb65ee640524d0052f229768c3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga1771b7fb65ee640524d0052f229768c3">BYTE_ORDER</a>&#160;&#160;&#160;LITTLE_ENDIAN</td></tr>
<tr class="separator:ga1771b7fb65ee640524d0052f229768c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77370c377781ee7489e30eaf772ea05a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga77370c377781ee7489e30eaf772ea05a">LWIP_RAND</a>()&#160;&#160;&#160;((u32_t)rand())</td></tr>
<tr class="separator:ga77370c377781ee7489e30eaf772ea05a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaccef167be13a500ce30036030a9b142b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaccef167be13a500ce30036030a9b142b">LWIP_PLATFORM_DIAG</a>(x)&#160;&#160;&#160;do {printf x;} while(0)</td></tr>
<tr class="separator:gaccef167be13a500ce30036030a9b142b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e8bcd0282525704d6dd596bdd1b47d0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga7e8bcd0282525704d6dd596bdd1b47d0">LWIP_PLATFORM_ASSERT</a>(x)</td></tr>
<tr class="separator:ga7e8bcd0282525704d6dd596bdd1b47d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga53954d507c09e521ec0d44a2450bb89d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga53954d507c09e521ec0d44a2450bb89d">LWIP_NO_STDDEF_H</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga53954d507c09e521ec0d44a2450bb89d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga122c754db96ecad23bc6f4541d6360c1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga122c754db96ecad23bc6f4541d6360c1">LWIP_NO_STDINT_H</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga122c754db96ecad23bc6f4541d6360c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5bf52d6f2729d0c8afd365f69d7d4373"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga5bf52d6f2729d0c8afd365f69d7d4373">LWIP_NO_INTTYPES_H</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga5bf52d6f2729d0c8afd365f69d7d4373"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gade9c8513419a799cd78a07ae894bb805"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gade9c8513419a799cd78a07ae894bb805">LWIP_NO_LIMITS_H</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:gade9c8513419a799cd78a07ae894bb805"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6871ce1e92ae09cdad39a9b230a3a800"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga6871ce1e92ae09cdad39a9b230a3a800">LWIP_NO_CTYPE_H</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga6871ce1e92ae09cdad39a9b230a3a800"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa0dd3f76dd9a837feaac61fedc0dbe72"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type,  val)&#160;&#160;&#160;((target_type)((ptrdiff_t)val))</td></tr>
<tr class="separator:gaa0dd3f76dd9a837feaac61fedc0dbe72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaade87973d72135b0b3afccfff4f62eb8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaade87973d72135b0b3afccfff4f62eb8">LWIP_ALIGNMENT_CAST</a>(target_type,  val)&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type, val)</td></tr>
<tr class="separator:gaade87973d72135b0b3afccfff4f62eb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga683e5c35d3263fe3145e6a6bc546604a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga683e5c35d3263fe3145e6a6bc546604a">LWIP_PTR_NUMERIC_CAST</a>(target_type,  val)&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type, val)</td></tr>
<tr class="separator:ga683e5c35d3263fe3145e6a6bc546604a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4488578f18ad1a76e4fa8bc288c51446"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga4488578f18ad1a76e4fa8bc288c51446">LWIP_PACKED_CAST</a>(target_type,  val)&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type, val)</td></tr>
<tr class="separator:ga4488578f18ad1a76e4fa8bc288c51446"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga651bb349041669fe717b19f127ef16c0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga651bb349041669fe717b19f127ef16c0">LWIP_DECLARE_MEMORY_ALIGNED</a>(variable_name,  size)&#160;&#160;&#160;u8_t variable_name[<a class="el" href="group__compiler__abstraction.html#ga25591dcb72fccc7b5dc46fbc1959694e">LWIP_MEM_ALIGN_BUFFER</a>(size)]</td></tr>
<tr class="separator:ga651bb349041669fe717b19f127ef16c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaef204be511fd32f681b55abc08e9ae18"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaef204be511fd32f681b55abc08e9ae18">LWIP_MEM_ALIGN_SIZE</a>(size)&#160;&#160;&#160;(((size) + <a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a> - 1U) &amp; ~(MEM_ALIGNMENT-1U))</td></tr>
<tr class="separator:gaef204be511fd32f681b55abc08e9ae18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga25591dcb72fccc7b5dc46fbc1959694e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga25591dcb72fccc7b5dc46fbc1959694e">LWIP_MEM_ALIGN_BUFFER</a>(size)&#160;&#160;&#160;(((size) + <a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a> - 1U))</td></tr>
<tr class="separator:ga25591dcb72fccc7b5dc46fbc1959694e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa8e8724eb1c220cbbb90de9e175ce1dc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaa8e8724eb1c220cbbb90de9e175ce1dc">LWIP_MEM_ALIGN</a>(addr)&#160;&#160;&#160;((void *)(((mem_ptr_t)(addr) + <a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a> - 1) &amp; ~(mem_ptr_t)(<a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a>-1)))</td></tr>
<tr class="separator:gaa8e8724eb1c220cbbb90de9e175ce1dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga73199061891adf1b912d20835c7d5e96"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga73199061891adf1b912d20835c7d5e96">PACK_STRUCT_BEGIN</a></td></tr>
<tr class="separator:ga73199061891adf1b912d20835c7d5e96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga465fef70f294e21cbf4ea51fc342f20e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga465fef70f294e21cbf4ea51fc342f20e">PACK_STRUCT_END</a></td></tr>
<tr class="separator:ga465fef70f294e21cbf4ea51fc342f20e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga33623da05bb55497534c3dc26ebebeb2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga33623da05bb55497534c3dc26ebebeb2">PACK_STRUCT_STRUCT</a></td></tr>
<tr class="separator:ga33623da05bb55497534c3dc26ebebeb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab0b988124e37a978d9a88e7c1c778e0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaab0b988124e37a978d9a88e7c1c778e0">PACK_STRUCT_FIELD</a>(x)&#160;&#160;&#160;x</td></tr>
<tr class="separator:gaab0b988124e37a978d9a88e7c1c778e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa8f75e4117374c2d09fbda5566e40b62"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gaa8f75e4117374c2d09fbda5566e40b62">PACK_STRUCT_FLD_8</a>(x)&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaab0b988124e37a978d9a88e7c1c778e0">PACK_STRUCT_FIELD</a>(x)</td></tr>
<tr class="separator:gaa8f75e4117374c2d09fbda5566e40b62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacc89e224363eb0ebca24b64d925c3cb7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#gacc89e224363eb0ebca24b64d925c3cb7">PACK_STRUCT_FLD_S</a>(x)&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaab0b988124e37a978d9a88e7c1c778e0">PACK_STRUCT_FIELD</a>(x)</td></tr>
<tr class="separator:gacc89e224363eb0ebca24b64d925c3cb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga57b90d36d8bea3798a5d1815945fd8ef"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga57b90d36d8bea3798a5d1815945fd8ef">PACK_STRUCT_USE_INCLUDES</a></td></tr>
<tr class="separator:ga57b90d36d8bea3798a5d1815945fd8ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga70624a5deb8b9199406372a7f3603ecf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga70624a5deb8b9199406372a7f3603ecf">LWIP_UNUSED_ARG</a>(x)&#160;&#160;&#160;(void)x</td></tr>
<tr class="separator:ga70624a5deb8b9199406372a7f3603ecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8e2cba4c97dd38f4d517ed21cf109ade"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compiler__abstraction.html#ga8e2cba4c97dd38f4d517ed21cf109ade">LWIP_PROVIDE_ERRNO</a></td></tr>
<tr class="separator:ga8e2cba4c97dd38f4d517ed21cf109ade"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>All defines related to this section must not be placed in lwipopts.h, but in arch/cc.h! If the compiler does not provide memset() this file must include a definition of it, or include a file which defines it. These options cannot be #defined in lwipopts.h since they are not options of lwIP itself, but options of the lwIP port to your system. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga1771b7fb65ee640524d0052f229768c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1771b7fb65ee640524d0052f229768c3">&#9670;&nbsp;</a></span>BYTE_ORDER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BYTE_ORDER&#160;&#160;&#160;LITTLE_ENDIAN</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define the byte order of the system. Needed for conversion of network data to host byte order. Allowed values: LITTLE_ENDIAN and BIG_ENDIAN </p>

</div>
</div>
<a id="gaade87973d72135b0b3afccfff4f62eb8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaade87973d72135b0b3afccfff4f62eb8">&#9670;&nbsp;</a></span>LWIP_ALIGNMENT_CAST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_ALIGNMENT_CAST</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">target_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">val&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type, val)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get rid of alignment cast warnings (GCC -Wcast-align) </p>

</div>
</div>
<a id="gaa0dd3f76dd9a837feaac61fedc0dbe72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa0dd3f76dd9a837feaac61fedc0dbe72">&#9670;&nbsp;</a></span>LWIP_CONST_CAST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_CONST_CAST</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">target_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">val&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((target_type)((ptrdiff_t)val))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>C++ const_cast&lt;target_type&gt;(val) equivalent to remove constness from a value (GCC -Wcast-qual) </p>

</div>
</div>
<a id="ga651bb349041669fe717b19f127ef16c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga651bb349041669fe717b19f127ef16c0">&#9670;&nbsp;</a></span>LWIP_DECLARE_MEMORY_ALIGNED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_DECLARE_MEMORY_ALIGNED</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">variable_name, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">size&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;u8_t variable_name[<a class="el" href="group__compiler__abstraction.html#ga25591dcb72fccc7b5dc46fbc1959694e">LWIP_MEM_ALIGN_BUFFER</a>(size)]</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Allocates a memory buffer of specified size that is of sufficient size to align its start address using LWIP_MEM_ALIGN. You can declare your own version here e.g. to enforce alignment without adding trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement requirements.<br />
e.g. if you use gcc and need 32 bit alignment:<br />
#define <a class="el" href="group__compiler__abstraction.html#ga651bb349041669fe717b19f127ef16c0">LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size)</a> u8_t variable_name[size] __attribute__((aligned(4)))<br />
or more portable:<br />
#define <a class="el" href="group__compiler__abstraction.html#ga651bb349041669fe717b19f127ef16c0">LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size)</a> u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)] </p>

</div>
</div>
<a id="gaa8e8724eb1c220cbbb90de9e175ce1dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa8e8724eb1c220cbbb90de9e175ce1dc">&#9670;&nbsp;</a></span>LWIP_MEM_ALIGN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_MEM_ALIGN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">addr</td><td>)</td>
          <td>&#160;&#160;&#160;((void *)(((mem_ptr_t)(addr) + <a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a> - 1) &amp; ~(mem_ptr_t)(<a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a>-1)))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Align a memory pointer to the alignment defined by MEM_ALIGNMENT so that ADDR % MEM_ALIGNMENT == 0 </p>

</div>
</div>
<a id="ga25591dcb72fccc7b5dc46fbc1959694e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga25591dcb72fccc7b5dc46fbc1959694e">&#9670;&nbsp;</a></span>LWIP_MEM_ALIGN_BUFFER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_MEM_ALIGN_BUFFER</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">size</td><td>)</td>
          <td>&#160;&#160;&#160;(((size) + <a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a> - 1U))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Calculate safe memory size for an aligned buffer when using an unaligned type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the start (e.g. if buffer is u8_t[] and actual data will be u32_t*) </p>

</div>
</div>
<a id="gaef204be511fd32f681b55abc08e9ae18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaef204be511fd32f681b55abc08e9ae18">&#9670;&nbsp;</a></span>LWIP_MEM_ALIGN_SIZE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_MEM_ALIGN_SIZE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">size</td><td>)</td>
          <td>&#160;&#160;&#160;(((size) + <a class="el" href="group__lwip__opts__mem.html#ga97343214666ee6dcb18c0bd77b441ea7">MEM_ALIGNMENT</a> - 1U) &amp; ~(MEM_ALIGNMENT-1U))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Calculate memory size for an aligned buffer - returns the next highest multiple of MEM_ALIGNMENT (e.g. <a class="el" href="group__compiler__abstraction.html#gaef204be511fd32f681b55abc08e9ae18">LWIP_MEM_ALIGN_SIZE(3)</a> and <a class="el" href="group__compiler__abstraction.html#gaef204be511fd32f681b55abc08e9ae18">LWIP_MEM_ALIGN_SIZE(4)</a> will both yield 4 for MEM_ALIGNMENT == 4). </p>

</div>
</div>
<a id="ga6871ce1e92ae09cdad39a9b230a3a800"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6871ce1e92ae09cdad39a9b230a3a800">&#9670;&nbsp;</a></span>LWIP_NO_CTYPE_H</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_NO_CTYPE_H&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define this to 1 in arch/cc.h of your port if your compiler does not provide the ctype.h header. If ctype.h is available, a few character functions are mapped to the appropriate functions (lwip_islower, lwip_isdigit...), if not, a private implementation is provided. </p>

</div>
</div>
<a id="ga5bf52d6f2729d0c8afd365f69d7d4373"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5bf52d6f2729d0c8afd365f69d7d4373">&#9670;&nbsp;</a></span>LWIP_NO_INTTYPES_H</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_NO_INTTYPES_H&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define this to 1 in arch/cc.h of your port if your compiler does not provide the inttypes.h header. You need to define the format strings listed in <a class="el" href="arch_8h.html">lwip/arch.h</a> yourself in this case (X8_F, U16_F...). </p>

</div>
</div>
<a id="gade9c8513419a799cd78a07ae894bb805"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gade9c8513419a799cd78a07ae894bb805">&#9670;&nbsp;</a></span>LWIP_NO_LIMITS_H</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_NO_LIMITS_H&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define this to 1 in arch/cc.h of your port if your compiler does not provide the limits.h header. You need to define the type limits yourself in this case (e.g. INT_MAX, SSIZE_MAX). </p>

</div>
</div>
<a id="ga53954d507c09e521ec0d44a2450bb89d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga53954d507c09e521ec0d44a2450bb89d">&#9670;&nbsp;</a></span>LWIP_NO_STDDEF_H</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_NO_STDDEF_H&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define this to 1 in arch/cc.h of your port if you do not want to include stddef.h header to get size_t. You need to typedef size_t by yourself in this case. </p>

</div>
</div>
<a id="ga122c754db96ecad23bc6f4541d6360c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga122c754db96ecad23bc6f4541d6360c1">&#9670;&nbsp;</a></span>LWIP_NO_STDINT_H</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_NO_STDINT_H&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define this to 1 in arch/cc.h of your port if your compiler does not provide the stdint.h header. You need to typedef the generic types listed in <a class="el" href="arch_8h.html">lwip/arch.h</a> yourself in this case (u8_t, u16_t...). </p>

</div>
</div>
<a id="ga4488578f18ad1a76e4fa8bc288c51446"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4488578f18ad1a76e4fa8bc288c51446">&#9670;&nbsp;</a></span>LWIP_PACKED_CAST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_PACKED_CAST</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">target_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">val&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type, val)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Avoid warnings/errors related to implicitly casting away packed attributes by doing a explicit cast </p>

</div>
</div>
<a id="ga7e8bcd0282525704d6dd596bdd1b47d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7e8bcd0282525704d6dd596bdd1b47d0">&#9670;&nbsp;</a></span>LWIP_PLATFORM_ASSERT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_PLATFORM_ASSERT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> {printf(<span class="stringliteral">&quot;Assertion \&quot;%s\&quot; failed at line %d in %s\n&quot;</span>, \</div><div class="line">                                     x, __LINE__, __FILE__); fflush(NULL); abort();} <span class="keywordflow">while</span>(0)</div></div><!-- fragment --><p>Platform specific assertion handling.<br />
Note the default implementation pulls in printf, fflush and abort, which may in turn pull in a lot of standard libary code. In resource-constrained systems, this should be defined to something less resource-consuming. </p>

</div>
</div>
<a id="gaccef167be13a500ce30036030a9b142b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaccef167be13a500ce30036030a9b142b">&#9670;&nbsp;</a></span>LWIP_PLATFORM_DIAG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_PLATFORM_DIAG</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;do {printf x;} while(0)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Platform specific diagnostic output.<br />
Note the default implementation pulls in printf, which may in turn pull in a lot of standard libary code. In resource-constrained systems, this should be defined to something less resource-consuming. </p>

</div>
</div>
<a id="ga8e2cba4c97dd38f4d517ed21cf109ade"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8e2cba4c97dd38f4d517ed21cf109ade">&#9670;&nbsp;</a></span>LWIP_PROVIDE_ERRNO</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_PROVIDE_ERRNO</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>LWIP_PROVIDE_ERRNO==1: Let lwIP provide ERRNO values and the 'errno' variable. If this is disabled, cc.h must either define 'errno', include &lt;errno.h&gt;, define LWIP_ERRNO_STDINCLUDE to get &lt;errno.h&gt; included or define LWIP_ERRNO_INCLUDE to &lt;errno.h&gt; or equivalent. </p>

</div>
</div>
<a id="ga683e5c35d3263fe3145e6a6bc546604a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga683e5c35d3263fe3145e6a6bc546604a">&#9670;&nbsp;</a></span>LWIP_PTR_NUMERIC_CAST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_PTR_NUMERIC_CAST</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">target_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">val&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaa0dd3f76dd9a837feaac61fedc0dbe72">LWIP_CONST_CAST</a>(target_type, val)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get rid of warnings related to pointer-to-numeric and vice-versa casts, e.g. "conversion from 'u8_t' to 'void *' of greater size" </p>

</div>
</div>
<a id="ga77370c377781ee7489e30eaf772ea05a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga77370c377781ee7489e30eaf772ea05a">&#9670;&nbsp;</a></span>LWIP_RAND</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_RAND</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;((u32_t)rand())</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define random number generator function of your system </p>

</div>
</div>
<a id="ga70624a5deb8b9199406372a7f3603ecf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga70624a5deb8b9199406372a7f3603ecf">&#9670;&nbsp;</a></span>LWIP_UNUSED_ARG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_UNUSED_ARG</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;(void)x</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Eliminates compiler warning about unused arguments (GCC -Wextra -Wunused). </p>

</div>
</div>
<a id="ga73199061891adf1b912d20835c7d5e96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga73199061891adf1b912d20835c7d5e96">&#9670;&nbsp;</a></span>PACK_STRUCT_BEGIN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_BEGIN</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Packed structs support. Placed BEFORE declaration of a packed struct.<br />
For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
<a id="ga465fef70f294e21cbf4ea51fc342f20e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga465fef70f294e21cbf4ea51fc342f20e">&#9670;&nbsp;</a></span>PACK_STRUCT_END</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_END</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Packed structs support. Placed AFTER declaration of a packed struct.<br />
For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
<a id="gaab0b988124e37a978d9a88e7c1c778e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaab0b988124e37a978d9a88e7c1c778e0">&#9670;&nbsp;</a></span>PACK_STRUCT_FIELD</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_FIELD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;x</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Packed structs support. Wraps u32_t and u16_t members.<br />
For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
<a id="gaa8f75e4117374c2d09fbda5566e40b62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa8f75e4117374c2d09fbda5566e40b62">&#9670;&nbsp;</a></span>PACK_STRUCT_FLD_8</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_FLD_8</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaab0b988124e37a978d9a88e7c1c778e0">PACK_STRUCT_FIELD</a>(x)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Packed structs support. Wraps u8_t members, where some compilers warn that packing is not necessary.<br />
For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
<a id="gacc89e224363eb0ebca24b64d925c3cb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacc89e224363eb0ebca24b64d925c3cb7">&#9670;&nbsp;</a></span>PACK_STRUCT_FLD_S</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_FLD_S</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#gaab0b988124e37a978d9a88e7c1c778e0">PACK_STRUCT_FIELD</a>(x)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Packed structs support. Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.<br />
For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
<a id="ga33623da05bb55497534c3dc26ebebeb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga33623da05bb55497534c3dc26ebebeb2">&#9670;&nbsp;</a></span>PACK_STRUCT_STRUCT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_STRUCT</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Packed structs support. Placed between end of declaration of a packed struct and trailing semicolon.<br />
For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
<a id="ga57b90d36d8bea3798a5d1815945fd8ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga57b90d36d8bea3798a5d1815945fd8ef">&#9670;&nbsp;</a></span>PACK_STRUCT_USE_INCLUDES</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PACK_STRUCT_USE_INCLUDES</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>PACK_STRUCT_USE_INCLUDES==1: Packed structs support using #include files before and after struct to be packed.<br />
The file included BEFORE the struct is "arch/bpstruct.h".<br />
The file included AFTER the struct is "arch/epstruct.h".<br />
This can be used to implement struct packing on MS Visual C compilers, see the Win32 port in the lwIP contrib repository for reference. For examples of packed struct declarations, see include/lwip/prot/ subfolder.<br />
A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
